/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package SourceCode;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import sun.util.BuddhistCalendar;

/**
 *
 * @author ssaad
 */
public class Loan implements Serializable
{
    private Copy copy;
    private Member member;;
    private Date CheckoutDate;
    private Date returnDate;
    

    public  Loan(Copy copy, Member member, Date CheckoutDate)
    {

            this.copy = copy;
            this.member = member;
            this.CheckoutDate = CheckoutDate;
            GregorianCalendar c = new BuddhistCalendar();
            c.setTime(CheckoutDate);
            c.add(Calendar.DAY_OF_MONTH, copy.getItem().getCheckoutlength());
            this.returnDate = c.getTime();

    }


    public Copy getCopy()
    {
        return copy;
    }
    public Member getMember()
    {
        return member;
    }



    public Date getCheckoutDate() {
        return CheckoutDate;
    }

    public Date getReturnDate() {
        return returnDate;
    }



}
